export const config = {
	options: {
		url: 'https://js.arcgis.com/4.27/init.js',
		css: 'https://js.arcgis.com/4.27/esri/themes/light/main.css'
	},
	// 需要加载的类
	modules: {
		Map: "esri/Map",
		MapView: "esri/views/MapView",
		WebTileLayer: "esri/layers/WebTileLayer",
		TileInfo: "esri/layers/support/TileInfo",
		TileLayer: "esri/layers/TileLayer",
		MapImageLayer: "esri/layers/MapImageLayer",
		FeatureLayer: "esri/layers/FeatureLayer",
		SpatialReference: "esri/geometry/SpatialReference",
		Extent: "esri/geometry/Extent",
		GraphicsLayer: 'esri/layers/GraphicsLayer',
		SketchViewModel: "esri/widgets/Sketch/SketchViewModel",
	}
}

// 天地图配置
export const tdt = {
	// 天地图的token
	TdtToken: 'ffa3d3e66e44049c8ab1ab2a7e600ef4',
	// 天地图的基础url
	TDTBaseUrl: 'http://{subDomain}.tianditu.gov.cn',
	subDomains: ["t0", "t1", "t2", "t3", "t4", "t5", "t6", "t7"],
	// 天地图切片信息
	tdtTileInfo: {
		dpi: 96,
		format: "PNG8",
		rows: 256,
		cols: 256,
		compressionQuality: 0,
		spatialReference: {
			"wkid": 4490
		},
		origin: {
			x: -180,
			y: 90
		},
		"lods": [{
			"level": 0,
			"levelValue": "1",
			"resolution": 0.7031249999999115,
			"scale": 2.958293554545284E8
		}, {
			"level": 1,
			"levelValue": "2",
			"resolution": 0.35156249999995576,
			"scale": 1.479146777272642E8
		}, {
			"level": 2,
			"levelValue": "3",
			"resolution": 0.17578124999997788,
			"scale": 7.39573388636321E7
		}, {
			"level": 3,
			"levelValue": "4",
			"resolution": 0.08789062499998894,
			"scale": 3.697866943181605E7
		}, {
			"level": 4,
			"levelValue": "5",
			"resolution": 0.04394531249999447,
			"scale": 1.8489334715908024E7
		}, {
			"level": 5,
			"levelValue": "6",
			"resolution": 0.021972656249997235,
			"scale": 9244667.357954012
		}, {
			"level": 6,
			"levelValue": "7",
			"resolution": 0.010986328124998617,
			"scale": 4622333.678977006
		}, {
			"level": 7,
			"levelValue": "8",
			"resolution": 0.005493164062499309,
			"scale": 2311166.839488503
		}, {
			"level": 8,
			"levelValue": "9",
			"resolution": 0.0027465820312496544,
			"scale": 1155583.4197442515
		}, {
			"level": 9,
			"levelValue": "10",
			"resolution": 0.0013732910156248272,
			"scale": 577791.7098721258
		}, {
			"level": 10,
			"levelValue": "11",
			"resolution": 6.866455078124136E-4,
			"scale": 288895.8549360629
		}, {
			"level": 11,
			"levelValue": "12",
			"resolution": 3.433227539062068E-4,
			"scale": 144447.92746803144
		}, {
			"level": 12,
			"levelValue": "13",
			"resolution": 1.716613769531034E-4,
			"scale": 72223.96373401572
		}, {
			"level": 13,
			"levelValue": "14",
			"resolution": 8.58306884765517E-5,
			"scale": 36111.98186700786
		}, {
			"level": 14,
			"levelValue": "15",
			"resolution": 4.291534423827585E-5,
			"scale": 18055.99093350393
		}, {
			"level": 15,
			"levelValue": "16",
			"resolution": 2.1457672119137925E-5,
			"scale": 9027.995466751965
		}, {
			"level": 16,
			"levelValue": "17",
			"resolution": 1.0728836059568962E-5,
			"scale": 4513.9977333759825
		}, {
			"level": 17,
			"levelValue": "18",
			"resolution": 5.364418029784481E-6,
			"scale": 2256.9988666879913
		}, {
			"level": 18,
			"levelValue": "19",
			"resolution": 2.6822090148922406E-6,
			"scale": 1128.4994333439956
		}, {
			"level": 19,
			"levelValue": "20",
			"resolution": 1.34110450744612E-06,
			"scale": 564.249716671995
		}, {
			"level": 20,
			"levelValue": "21",
			"resolution": 6.7055225372306E-07,
			"scale": 282.124858335997
		}, {
			"level": 21,
			"levelValue": "22",
			"resolution": 3.3527612686153E-07,
			"scale": 141.062429167999
		}, {
			"level": 22,
			"levelValue": "23",
			"resolution": 1.67638063430765E-07,
			"scale": 70.5312145839994
		}]
	}
}

// 基础服务配置
export const baseServers = [
	// 影像底图
	{
		"id": "TDTImageServer",
		"title": "影像底图",
		"service": "WMTS",
		"layerType": "img",
		"version": "1.0.0",
		"request": "GetTile",
		"tileMatrixSet": "c",
		"style": "default",
		"format": "tiles",
		"visible": true,
		"serviceType": "tianditu",
		"legendEnabled": false,
		"opacity": 1,
		"sublayers": [{
			"id": 0,
			"visible": true
		}]
	},
	// 矢量注记
	{
		"id": "TDTMarkServer",
		"title": "矢量注记",
		"service": "WMTS",
		"layerType": "cva",
		"version": "1.0.0",
		"request": "GetTile",
		"tileMatrixSet": "c",
		"style": "default",
		"format": "tiles",
		"visible": true,
		"serviceType": "tianditu",
		"legendEnabled": false,
		"opacity": 1,
		"sublayers": [{
			"id": 0,
			"visible": true
		}]
	}
]

// SYMBOL配置
export const symbol = {
	// 点
	point: {
		type: "simple-marker",
		style: "circle",
		size: 10,
		color: [255, 128, 0, 0.8],
		outline: {
			color: [255, 128, 0, 1],
			size: 10
		}
	},
	// 线
	polyline: {
		type: "simple-line",
		color: [255, 128, 0, 1],
		width: 2
	},
	// 面
	polygon: {
		type: "simple-fill",
		color: [255, 128, 0, 0.3],
		outline: {
			color: [255, 128, 0, 1],
			width: 2
		}
	}
}